import pygame


class Scene(pygame.sprite.Group):
    def __init__(self, scene_name):
        super().__init__()
        self.scene_name = scene_name

    def Destroy(self):
        from constants import game
        for sp in self.sprites():
            from Lib.Core.UISprite import UISprite
            from Lib.Core.UIBase import UIBase
            if isinstance(sp, UISprite):
                sp.Destroy()
            elif isinstance(sp, UIBase):
                sp.Destroy()
        game.scene.remove(self.sprites())
        game.ui_group.empty()
        game.scene.empty()
        game.scene = None
